<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3"><a id="head" ></a>角色管理</h1>
</div>
<div class="col-sm-12" ng-controller="roleViewController">
    <ng-form role="form" name="form" class="form-validation">
        <uib-tabset justified="true" class="tab-container">
            <uib-tab heading="基本信息">
                <div class="panel panel-default">
                    <div class="panel-heading">
                    </div>

                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">角色名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control m-b-xs" placeholder="角色名" ng-model="entity.name" required >
                            </div>
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">角色</label>
                            <div class="col-sm-9">
                                <input type="text" name="role" class="form-control m-b-xs" ui-validate-async="{unique : 'unique($value)' }" placeholder="角色" ng-model="entity.role" required >
                                <div class="bg-danger" ng-show="form.role.$invalid">
                                    <div ng-show="form.role.$error.unique">角色名已经存在，请重新输入。</div>
                                </div>
                            </div>
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group" ng-repeat="auth in Grid.getSelectedRows()">
                            <label class="col-sm-3 control-label">权限</label>
                            <div class="col-sm-9">
                                <p>{{auth.name}}</p>
                            </div>
                        </div>
                    </div>
                </div>
            </uib-tab>
            <uib-tab heading="权限信息" select="Grid.resize()">
                <div class="table-responsive">
                    <div ui-grid="Grid.gridOptions" ui-grid-resize-columns ui-grid-selection ui-grid-pagination ui-grid-move-columns class="ag-fresh" style="min-height: 500px;"></div>
                </div>
            </uib-tab>
        </uib-tabset>
        <footer class="panel-footer  lter">
            <!-- alert -->
            <div class="m-b-md">
                <uib-alert ng-repeat="alert in Alert.alerts" type="{{alert.type}}" close="Alert.closeAlert($index)">{{alert.msg}}</uib-alert>
            </div>
            <!-- / alert -->
            <button type="submit" class="btn btn-success" ng-disabled="form.$invalid || saveBtnDisable" ng-click="save(); saveBtnDisable = true;">保存</button>
            <button type="submit" class="btn btn-success" ng-click="canle()">返回</button>
        </footer>
    </ng-form>
</div>